window.onload = function () {
  var appEle = document.querySelector("#app");
  var fixedEle = document.querySelector(".header");
  var footerEle = document.querySelector(".footer");
  var homeEle = document.querySelector(".home");
  var personalEle = document.querySelector(".personal");

  if (fixedEle) {
    appEle.style.paddingTop = fixedEle.offsetHeight + 'px';
    appEle.style.paddingBottom = footerEle.offsetHeight + 'px';

    window.onresize = function () {
      // console.log(fixedEle.offsetHeight);
      appEle.style.paddingTop = fixedEle.offsetHeight + 'px';
      appEle.style.paddingBottom = footerEle.offsetHeight + 'px';
      console.log(footerEle.offsetHeight);
    }
  }

  console.log(homeEle);
  homeEle.addEventListener("click", function () {
    // console.log("111");
    // console.log(this.parentNode.children.length);
    var _that = this;
    forword("/index.html", _that);
  })

  personalEle.addEventListener("touchstart", function () {
    // console.log("111");
    var _that = this;
    forword("/mine.html", _that);
  }, true)

  function forword(val, _that) {
    location.href = val;
    // setTimeout(function () {
    //   let parentNode = _that.parentNode;
    //   let length = _that.parentNode.children.length;
    //   for (var i = 0; i < length; i++) {
    //     parentNode.children[i].setAttribute("target", "");
    //   }
    //   _that.setAttribute("target", "footer-current-icon");
    // }, 1000)
  }
}